package com.example.uitls;

import android.util.Log;

/**
 * Created by leonardo on 17/5/27.
 */

public class LogUtils {

    public static final String LOG_TAG = ResUtils.getInstance().getString(R.string.app_name);
    // 运行时 屏蔽 日志输出
    public static boolean DEBUG = BuildConfig.DEBUG;

    public LogUtils() {
		        /* cannot be instantiated */
		throw new UnsupportedOperationException("cannot be instantiated");
    }

    public static final void analytics(String log) {
        if (DEBUG)
            Log.d(LOG_TAG, log);
    }

    public static final void error(String log) {
        if (DEBUG)
            Log.e(LOG_TAG, "" + log);
    }

    public static final void log(String log) {
        if (DEBUG)
            Log.i(LOG_TAG, log);
    }

    public static final void log(String tag, String log) {
        if (DEBUG)
            Log.i(tag, log);
    }

    public static final void logv(String log) {
        if (DEBUG)
            Log.v(LOG_TAG, log);
    }

    public static final void warn(String log) {
        if (DEBUG)
            Log.w(LOG_TAG, log);
    }
}
